let salary = [5000, 8000, 12000, 18000]
// let newSalary=salary.map(function(item,index){
//     return item*2
// })
// console.log(newSalary)
function mapp(fn) {
    let newArr = []
    let arr = this
    for (var i = 0; i < arr.length; i++) {
        newArr.push(fn(arr[i], i, arr))
    }
    console.log(newArr)
    return newArr
}
Array.prototype.mapp = mapp
let res = salary.mapp(function (item, index, array) {
    return item * 2
})
